<template>
  <el-menu
  :default-active="activeIndex"
  class="el-menu-demo"
  mode="horizontal"
  @select="handleSelect"
  background-color="#545c64"
  text-color="#fff"
  active-text-color="#ffd04b">
  <el-menu-item index="item.index" v-for="item in list" :key="item.id">{{item.name}}</el-menu-item>
</el-menu>
</template>
<script>
export default {
  name: "eduteacherHeader",
  data() {
    return {
      activeIndex: "1",
      list: []
    };
  },
  mounted: function() {
    this.load();
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);

    },
    load() {
      this.ajax({
        url: this.API.teacher.header,
        data: {},
        success: resultData => {
          this.list = resultData.data
        }
      });
    }
  }
};
</script>

<style scoped>

</style>